#version 450 compatibility





layout(location = 0) in vec4 vPosition;
layout(location = 1) in vec4 vNormal;
layout(location = 2) in vec2 vTCoord;

layout(std140, binding = 0) uniform u_TranformMat {
    mat4 TranformMat; 
};




/******************************输出到下一阶段****************************************/

out vec4 Normal;
out vec2 TCoord;



void main(){
    Normal = vNormal;
    TCoord = vTCoord;

    mat4 mvm;


//-------------------------------实例----------------------------
#ifdef DEF_Instnced
    mvm = (gl_ModelViewMatrix * TranformMat[gl_InstanceID]);
#else
    mvm = (gl_ModelViewMatrix * TranformMat);
#endif

    
//-------------------------------细分----------------------------
#ifdef DEF_Tessellation
    gl_Position = (mvm*vPosition);
#else
    gl_Position = gl_ProjectionMatrix * (mvm*vPosition);
#endif
    

}



